Skip to content

refactor(limrun): compose the v2 plugin factory - #4723

Merged
thymikee merged 8 commits into
0.22from
refactor/0.22-limrun-plugin-factory
Nov 19, 2026
Merged

thymikee merged 8 commits into
0.22from
refactor/0.22-limrun-plugin-factory

Conversation

@thymikee

@thymikee thymikee commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Summary

Move Limrun’s v2 factory, credential interpretation, and connection callbacks into the provider package. The 0.22 daemon composes the built-in candidate with its existing lease-scoped runtime adapter. Connection verification loads independently of the runtime. Credential fingerprints, connection identity, and HAR ownership remain stable.

This is part of #3311 and #3759. It includes the connection work merged in #4730. It now targets 0.22 directly and replaces #4720, which closed into it. From #4720 it keeps one type-only change: createLimrunIosRunner takes Pick<AppleApplicationTools, 'resolveOpenTarget' | 'applyRuntimeHints' | 'clearRuntimeHints'>, and createRunner passes only those three tools. limrunPlugin now declares its connection in its return type, so the built-in connection has no unreachable guard.

Validation

  • Base 0.22 56e11de63d, tested head 39299ab340196a2e502607d9eb56d4de256158e4.
  • pnpm check:affected --run --base 56e11de63d --head 39299ab340 passed at the exact commit with an unchanged checkout (42 passed, 25 skipped).
  • Rebased onto 0.22 after 0.22 was rebased onto main. Two conflicts in packages/provider-limrun/src/index.ts were resolved by dropping the root LIMRUN_PROFILE_FIELDS and LimrunRuntime exports, which have no consumers. Hosted checks and review are pending at this head.
  • Live Limrun provider acceptance stays pending for refactor(provider-limrun): ship Limrun as the @agent-device/limrun plugin #3311.

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

View guided diff Turn on auto-fix

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.14 MB 6.14 MB +1.2 kB
Package (unpacked) 6.13 MB 6.14 MB +1.2 kB
Package (download) 1.86 MB 1.86 MB -119 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 22.2 ms 25.6 ms +3.4 ms
CLI --help 47.2 ms 48.7 ms +1.5 ms

@apex-sentinel-staging

This comment has been minimized.

@thymikee

Copy link
Copy Markdown
Member Author

This PR is ready at 4b7e616. I found no blocking problems, and hosted CI is green with 20 checks and none failing. There are no conflicts, and nothing blocks this layer, but merge order follows #4720 (base refactor/0.22-limrun-provider-host). This PR does not read the facets, so narrowing them in #4720 should not change it. The PR body already lists live provider acceptance as pending for the stack.

Not blocking, and you can take or leave these: limrunPlatformForLeaseBackend in credentials.ts wraps platformForLimrunLeaseBackend in device.ts, and the backend-to-platform table is written again as the backends tuple in limrunCredentialDeclaration, so one table in device.ts that both enumerate would be enough; the full credential declaration table is asserted in both plugin.test.ts and builtin-provider-plugins.test.ts, while the composition test never checks the HAR directory derived from AGENT_DEVICE_STATE_DIR, so asserting <AGENT_DEVICE_STATE_DIR>/network-har there and keeping the table only in the unit test would cover the value the root supplies; and the missing_provider_credentials branch in plugin.ts cannot fire in the built-in composition, which is fine if it serves the external-plugin path.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 19, 2026
@thymikee
thymikee added this pull request to stack #4731 November 19, 2026 08:55
@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging

This comment has been minimized.

@thymikee

Copy link
Copy Markdown
Member Author

This PR is ready from the code side at 77435a4, and the earlier review of 4b7e616 still holds.

Not blocking, and you can take or leave it: builtinLimrunConnection in builtin-provider-plugins.ts throws when plugin.connection is undefined, but limrunPlugin always declares it, so the guard cannot fire. If limrunPlugin returned AgentDevicePlugin & { connection: PluginConnection }, the guard would go away.

Nearly every CI job on this head was cancelled, and the one failure is the Smoke Tests aggregate whose iOS and macOS children were cancelled. The cancelled jobs have been re-run; please let them finish green before merge. Merge still follows #4720. Live Limrun verification stays pending for the stack, and this move does not need it.

…ials to the provider package

Issue #3311. Builds on #4720 (provider-plugin host).

- Add packages/provider-limrun/src/plugin.ts: the single transitional
  limrunPlugin(options) factory. Its setup reads credentials, builds
  runtime dependencies through the injected plugin host, and loads the
  runtime with the platform module; its credentials declaration keeps
  per-backend fingerprint narrowing.
- Move the credential reader and declaration from
  src/provider-limrun-credentials.ts to
  packages/provider-limrun/src/credentials.ts so the provider package
  owns credential interpretation.
- Expose the factory through the new lazy, SDK-free
  @agent-device/provider-limrun/internal entry; the built-in candidate
  in src/builtin-provider-plugins.ts composes the factory with the
  root-owned runtime dependencies and state paths, preserving
  dormant/failed/active candidate semantics.
- Rewire src/cli/connection and the daemon credential test to the
  internal entry; drop the migrated root-module-zone row; update the
  boundary and dependency pins, package manifests, and lockfile.
…wn v2 connection callbacks

Move the connect decisions into one provider-owned set of callbacks: the connect-flag
refusals (including --device), the per-platform credential narrowing, the connection
capabilities, and the verification read-only check now live in the provider package's
connection module, which the plugin declares lazily. The CLI composition drops its
hand-written Limrun adapter and runs the same callbacks through the plugin shape, wired
to the host the way the daemon's registry wires an installed plugin's, so both answers
come from the provider. The profile fields the host owns stay with the host: tenant,
session, run identity, state dir, and Metro settings.
The built-in `connect` composed its provider's callbacks through the provider package's root entry
just to inject that provider's own read-only check, which evaluated the runtime the composition was
meant to keep lazy, and let a caller replace a verification it does not own. The connection now
loads the provider's own verification in the `verify` path alone, so the built-in and an installed
plugin answer with the same entry and nothing above the connection decides what it verifies through;
the plugin option, the verifier type, and the root's verification export go with it. The suites read
the Limrun SDK boundary instead of the provider package, so they assert what the account or the
attached instance is asked for: the scoped credentials, the host's version, and the selected
platform, with no runtime set up on `connect`.
limrunPlugin always declares a connection, so its type says so and the built-in connection no longer checks for a missing one.
@thymikee
thymikee force-pushed the refactor/0.22-limrun-plugin-factory branch from 77435a4 to 39299ab Compare November 19, 2026 14:22
@thymikee
thymikee removed this pull request from stack #4731 November 19, 2026 14:22
@thymikee
thymikee changed the base branch from refactor/0.22-limrun-provider-host to 0.22 November 19, 2026 14:22
@thymikee

Copy link
Copy Markdown
Member Author

Rebased onto 0.22 at 39299ab340, after 0.22 was rebased onto main (56e11de63d). This PR now targets 0.22 directly, and #4720 is closed into it. It adds two commits: the type-only Apple tools narrowing from #4720, and your optional note (limrunPlugin returns AgentDevicePlugin & { connection: PluginConnection }, so the guard in builtinLimrunConnection is gone). Exact affected validation passed (42 passed, 25 skipped). The earlier review was at 77435a4, so this head needs review again.

@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of 39299ab

Since the review of 77435a4: 0 new · 0 still open · 0 no longer raised

No open findings.

Not in the reviewers' prompt (1 file)
  • pnpm-lock.yaml: generated or a lockfile, so its lines were left out

1 finding below minor hidden (user_settings.min_severity).

Reviewed with this repository's own Sentinel configuration (7b6500cd2da2).

💬 Talking to Sentinel

In a finding's thread, reply with:

Command What it does
@apex-sentinel-staging note <context> Adds context; Sentinel re-checks the cited code
@apex-sentinel-staging pivot <why> Says the finding is wrong; Sentinel re-checks the cited code
@apex-sentinel-staging like Marks the finding as useful
@apex-sentinel-staging dislike <why> Marks it as not useful, so it is not raised again

On this conversation, comment @apex-sentinel-staging review to run a full review once again.

@thymikee

Copy link
Copy Markdown
Member Author

This PR is ready: the delta at 39299ab is clean and the earlier review (#4723 (comment)) found nothing to fix. CI is green, with 19 checks and none failing at this head.

Not blocking, and fine to take or leave: limrun-ios-runner.ts now has a second inline copy of the Pick<AppleApplicationTools, 'resolveOpenTarget' | 'applyRuntimeHints' | 'clearRuntimeHints'> type that already sits in limrun-ios-application-tools.ts, so one exported named type would serve both.

This delta is type-only and changes no device route, so it needs no live run. Live Limrun acceptance stays tracked under #3311, and the merge decision is the maintainer's.

@thymikee
thymikee merged commit 91d3628 into 0.22 Nov 19, 2026
19 checks passed
@thymikee
thymikee deleted the refactor/0.22-limrun-plugin-factory branch November 19, 2026 15:14
thymikee added a commit that referenced this pull request Nov 19, 2026
* refactor(limrun): add transitional v2 plugin factory and move credentials to the provider package

Issue #3311. Builds on #4720 (provider-plugin host).

- Add packages/provider-limrun/src/plugin.ts: the single transitional
  limrunPlugin(options) factory. Its setup reads credentials, builds
  runtime dependencies through the injected plugin host, and loads the
  runtime with the platform module; its credentials declaration keeps
  per-backend fingerprint narrowing.
- Move the credential reader and declaration from
  src/provider-limrun-credentials.ts to
  packages/provider-limrun/src/credentials.ts so the provider package
  owns credential interpretation.
- Expose the factory through the new lazy, SDK-free
  @agent-device/provider-limrun/internal entry; the built-in candidate
  in src/builtin-provider-plugins.ts composes the factory with the
  root-owned runtime dependencies and state paths, preserving
  dormant/failed/active candidate semantics.
- Rewire src/cli/connection and the daemon credential test to the
  internal entry; drop the migrated root-module-zone row; update the
  boundary and dependency pins, package manifests, and lockfile.

* test(limrun): read credential names from plugin inventory

* style(limrun): format the reconciled factory call

* refactor(limrun): route the built-in connect through the provider's own v2 connection callbacks

Move the connect decisions into one provider-owned set of callbacks: the connect-flag
refusals (including --device), the per-platform credential narrowing, the connection
capabilities, and the verification read-only check now live in the provider package's
connection module, which the plugin declares lazily. The CLI composition drops its
hand-written Limrun adapter and runs the same callbacks through the plugin shape, wired
to the host the way the daemon's registry wires an installed plugin's, so both answers
come from the provider. The profile fields the host owns stay with the host: tenant,
session, run identity, state dir, and Metro settings.

* fix(limrun): retain saved named-session identity

* refactor(limrun): keep the connection's verification inside the provider

The built-in `connect` composed its provider's callbacks through the provider package's root entry
just to inject that provider's own read-only check, which evaluated the runtime the composition was
meant to keep lazy, and let a caller replace a verification it does not own. The connection now
loads the provider's own verification in the `verify` path alone, so the built-in and an installed
plugin answer with the same entry and nothing above the connection decides what it verifies through;
the plugin option, the verifier type, and the root's verification export go with it. The suites read
the Limrun SDK boundary instead of the provider package, so they assert what the account or the
attached instance is asked for: the scoped credentials, the host's version, and the selected
platform, with no runtime set up on `connect`.

* refactor(limrun): pass only the three Apple tools the iOS runner uses

* refactor(limrun): declare the plugin's connection in its return type

limrunPlugin always declares a connection, so its type says so and the built-in connection no longer checks for a missing one.
thymikee added a commit that referenced this pull request Nov 20, 2026
* refactor(limrun): add transitional v2 plugin factory and move credentials to the provider package

Issue #3311. Builds on #4720 (provider-plugin host).

- Add packages/provider-limrun/src/plugin.ts: the single transitional
  limrunPlugin(options) factory. Its setup reads credentials, builds
  runtime dependencies through the injected plugin host, and loads the
  runtime with the platform module; its credentials declaration keeps
  per-backend fingerprint narrowing.
- Move the credential reader and declaration from
  src/provider-limrun-credentials.ts to
  packages/provider-limrun/src/credentials.ts so the provider package
  owns credential interpretation.
- Expose the factory through the new lazy, SDK-free
  @agent-device/provider-limrun/internal entry; the built-in candidate
  in src/builtin-provider-plugins.ts composes the factory with the
  root-owned runtime dependencies and state paths, preserving
  dormant/failed/active candidate semantics.
- Rewire src/cli/connection and the daemon credential test to the
  internal entry; drop the migrated root-module-zone row; update the
  boundary and dependency pins, package manifests, and lockfile.

* test(limrun): read credential names from plugin inventory

* style(limrun): format the reconciled factory call

* refactor(limrun): route the built-in connect through the provider's own v2 connection callbacks

Move the connect decisions into one provider-owned set of callbacks: the connect-flag
refusals (including --device), the per-platform credential narrowing, the connection
capabilities, and the verification read-only check now live in the provider package's
connection module, which the plugin declares lazily. The CLI composition drops its
hand-written Limrun adapter and runs the same callbacks through the plugin shape, wired
to the host the way the daemon's registry wires an installed plugin's, so both answers
come from the provider. The profile fields the host owns stay with the host: tenant,
session, run identity, state dir, and Metro settings.

* fix(limrun): retain saved named-session identity

* refactor(limrun): keep the connection's verification inside the provider

The built-in `connect` composed its provider's callbacks through the provider package's root entry
just to inject that provider's own read-only check, which evaluated the runtime the composition was
meant to keep lazy, and let a caller replace a verification it does not own. The connection now
loads the provider's own verification in the `verify` path alone, so the built-in and an installed
plugin answer with the same entry and nothing above the connection decides what it verifies through;
the plugin option, the verifier type, and the root's verification export go with it. The suites read
the Limrun SDK boundary instead of the provider package, so they assert what the account or the
attached instance is asked for: the scoped credentials, the host's version, and the selected
platform, with no runtime set up on `connect`.

* refactor(limrun): pass only the three Apple tools the iOS runner uses

* refactor(limrun): declare the plugin's connection in its return type

limrunPlugin always declares a connection, so its type says so and the built-in connection no longer checks for a missing one.
thymikee added a commit that referenced this pull request Nov 20, 2026
* refactor(limrun): add transitional v2 plugin factory and move credentials to the provider package

Issue #3311. Builds on #4720 (provider-plugin host).

- Add packages/provider-limrun/src/plugin.ts: the single transitional
  limrunPlugin(options) factory. Its setup reads credentials, builds
  runtime dependencies through the injected plugin host, and loads the
  runtime with the platform module; its credentials declaration keeps
  per-backend fingerprint narrowing.
- Move the credential reader and declaration from
  src/provider-limrun-credentials.ts to
  packages/provider-limrun/src/credentials.ts so the provider package
  owns credential interpretation.
- Expose the factory through the new lazy, SDK-free
  @agent-device/provider-limrun/internal entry; the built-in candidate
  in src/builtin-provider-plugins.ts composes the factory with the
  root-owned runtime dependencies and state paths, preserving
  dormant/failed/active candidate semantics.
- Rewire src/cli/connection and the daemon credential test to the
  internal entry; drop the migrated root-module-zone row; update the
  boundary and dependency pins, package manifests, and lockfile.

* test(limrun): read credential names from plugin inventory

* style(limrun): format the reconciled factory call

* refactor(limrun): route the built-in connect through the provider's own v2 connection callbacks

Move the connect decisions into one provider-owned set of callbacks: the connect-flag
refusals (including --device), the per-platform credential narrowing, the connection
capabilities, and the verification read-only check now live in the provider package's
connection module, which the plugin declares lazily. The CLI composition drops its
hand-written Limrun adapter and runs the same callbacks through the plugin shape, wired
to the host the way the daemon's registry wires an installed plugin's, so both answers
come from the provider. The profile fields the host owns stay with the host: tenant,
session, run identity, state dir, and Metro settings.

* fix(limrun): retain saved named-session identity

* refactor(limrun): keep the connection's verification inside the provider

The built-in `connect` composed its provider's callbacks through the provider package's root entry
just to inject that provider's own read-only check, which evaluated the runtime the composition was
meant to keep lazy, and let a caller replace a verification it does not own. The connection now
loads the provider's own verification in the `verify` path alone, so the built-in and an installed
plugin answer with the same entry and nothing above the connection decides what it verifies through;
the plugin option, the verifier type, and the root's verification export go with it. The suites read
the Limrun SDK boundary instead of the provider package, so they assert what the account or the
attached instance is asked for: the scoped credentials, the host's version, and the selected
platform, with no runtime set up on `connect`.

* refactor(limrun): pass only the three Apple tools the iOS runner uses

* refactor(limrun): declare the plugin's connection in its return type

limrunPlugin always declares a connection, so its type says so and the built-in connection no longer checks for a missing one.
thymikee added a commit that referenced this pull request Nov 21, 2026
* refactor(limrun): add transitional v2 plugin factory and move credentials to the provider package

Issue #3311. Builds on #4720 (provider-plugin host).

- Add packages/provider-limrun/src/plugin.ts: the single transitional
  limrunPlugin(options) factory. Its setup reads credentials, builds
  runtime dependencies through the injected plugin host, and loads the
  runtime with the platform module; its credentials declaration keeps
  per-backend fingerprint narrowing.
- Move the credential reader and declaration from
  src/provider-limrun-credentials.ts to
  packages/provider-limrun/src/credentials.ts so the provider package
  owns credential interpretation.
- Expose the factory through the new lazy, SDK-free
  @agent-device/provider-limrun/internal entry; the built-in candidate
  in src/builtin-provider-plugins.ts composes the factory with the
  root-owned runtime dependencies and state paths, preserving
  dormant/failed/active candidate semantics.
- Rewire src/cli/connection and the daemon credential test to the
  internal entry; drop the migrated root-module-zone row; update the
  boundary and dependency pins, package manifests, and lockfile.

* test(limrun): read credential names from plugin inventory

* style(limrun): format the reconciled factory call

* refactor(limrun): route the built-in connect through the provider's own v2 connection callbacks

Move the connect decisions into one provider-owned set of callbacks: the connect-flag
refusals (including --device), the per-platform credential narrowing, the connection
capabilities, and the verification read-only check now live in the provider package's
connection module, which the plugin declares lazily. The CLI composition drops its
hand-written Limrun adapter and runs the same callbacks through the plugin shape, wired
to the host the way the daemon's registry wires an installed plugin's, so both answers
come from the provider. The profile fields the host owns stay with the host: tenant,
session, run identity, state dir, and Metro settings.

* fix(limrun): retain saved named-session identity

* refactor(limrun): keep the connection's verification inside the provider

The built-in `connect` composed its provider's callbacks through the provider package's root entry
just to inject that provider's own read-only check, which evaluated the runtime the composition was
meant to keep lazy, and let a caller replace a verification it does not own. The connection now
loads the provider's own verification in the `verify` path alone, so the built-in and an installed
plugin answer with the same entry and nothing above the connection decides what it verifies through;
the plugin option, the verifier type, and the root's verification export go with it. The suites read
the Limrun SDK boundary instead of the provider package, so they assert what the account or the
attached instance is asked for: the scoped credentials, the host's version, and the selected
platform, with no runtime set up on `connect`.

* refactor(limrun): pass only the three Apple tools the iOS runner uses

* refactor(limrun): declare the plugin's connection in its return type

limrunPlugin always declares a connection, so its type says so and the built-in connection no longer checks for a missing one.
thymikee added a commit that referenced this pull request Nov 21, 2026
* refactor(limrun): add transitional v2 plugin factory and move credentials to the provider package

Issue #3311. Builds on #4720 (provider-plugin host).

- Add packages/provider-limrun/src/plugin.ts: the single transitional
  limrunPlugin(options) factory. Its setup reads credentials, builds
  runtime dependencies through the injected plugin host, and loads the
  runtime with the platform module; its credentials declaration keeps
  per-backend fingerprint narrowing.
- Move the credential reader and declaration from
  src/provider-limrun-credentials.ts to
  packages/provider-limrun/src/credentials.ts so the provider package
  owns credential interpretation.
- Expose the factory through the new lazy, SDK-free
  @agent-device/provider-limrun/internal entry; the built-in candidate
  in src/builtin-provider-plugins.ts composes the factory with the
  root-owned runtime dependencies and state paths, preserving
  dormant/failed/active candidate semantics.
- Rewire src/cli/connection and the daemon credential test to the
  internal entry; drop the migrated root-module-zone row; update the
  boundary and dependency pins, package manifests, and lockfile.

* test(limrun): read credential names from plugin inventory

* style(limrun): format the reconciled factory call

* refactor(limrun): route the built-in connect through the provider's own v2 connection callbacks

Move the connect decisions into one provider-owned set of callbacks: the connect-flag
refusals (including --device), the per-platform credential narrowing, the connection
capabilities, and the verification read-only check now live in the provider package's
connection module, which the plugin declares lazily. The CLI composition drops its
hand-written Limrun adapter and runs the same callbacks through the plugin shape, wired
to the host the way the daemon's registry wires an installed plugin's, so both answers
come from the provider. The profile fields the host owns stay with the host: tenant,
session, run identity, state dir, and Metro settings.

* fix(limrun): retain saved named-session identity

* refactor(limrun): keep the connection's verification inside the provider

The built-in `connect` composed its provider's callbacks through the provider package's root entry
just to inject that provider's own read-only check, which evaluated the runtime the composition was
meant to keep lazy, and let a caller replace a verification it does not own. The connection now
loads the provider's own verification in the `verify` path alone, so the built-in and an installed
plugin answer with the same entry and nothing above the connection decides what it verifies through;
the plugin option, the verifier type, and the root's verification export go with it. The suites read
the Limrun SDK boundary instead of the provider package, so they assert what the account or the
attached instance is asked for: the scoped credentials, the host's version, and the selected
platform, with no runtime set up on `connect`.

* refactor(limrun): pass only the three Apple tools the iOS runner uses

* refactor(limrun): declare the plugin's connection in its return type

limrunPlugin always declares a connection, so its type says so and the built-in connection no longer checks for a missing one.
thymikee added a commit that referenced this pull request Nov 23, 2026
* refactor(limrun): add transitional v2 plugin factory and move credentials to the provider package

Issue #3311. Builds on #4720 (provider-plugin host).

- Add packages/provider-limrun/src/plugin.ts: the single transitional
  limrunPlugin(options) factory. Its setup reads credentials, builds
  runtime dependencies through the injected plugin host, and loads the
  runtime with the platform module; its credentials declaration keeps
  per-backend fingerprint narrowing.
- Move the credential reader and declaration from
  src/provider-limrun-credentials.ts to
  packages/provider-limrun/src/credentials.ts so the provider package
  owns credential interpretation.
- Expose the factory through the new lazy, SDK-free
  @agent-device/provider-limrun/internal entry; the built-in candidate
  in src/builtin-provider-plugins.ts composes the factory with the
  root-owned runtime dependencies and state paths, preserving
  dormant/failed/active candidate semantics.
- Rewire src/cli/connection and the daemon credential test to the
  internal entry; drop the migrated root-module-zone row; update the
  boundary and dependency pins, package manifests, and lockfile.

* test(limrun): read credential names from plugin inventory

* style(limrun): format the reconciled factory call

* refactor(limrun): route the built-in connect through the provider's own v2 connection callbacks

Move the connect decisions into one provider-owned set of callbacks: the connect-flag
refusals (including --device), the per-platform credential narrowing, the connection
capabilities, and the verification read-only check now live in the provider package's
connection module, which the plugin declares lazily. The CLI composition drops its
hand-written Limrun adapter and runs the same callbacks through the plugin shape, wired
to the host the way the daemon's registry wires an installed plugin's, so both answers
come from the provider. The profile fields the host owns stay with the host: tenant,
session, run identity, state dir, and Metro settings.

* fix(limrun): retain saved named-session identity

* refactor(limrun): keep the connection's verification inside the provider

The built-in `connect` composed its provider's callbacks through the provider package's root entry
just to inject that provider's own read-only check, which evaluated the runtime the composition was
meant to keep lazy, and let a caller replace a verification it does not own. The connection now
loads the provider's own verification in the `verify` path alone, so the built-in and an installed
plugin answer with the same entry and nothing above the connection decides what it verifies through;
the plugin option, the verifier type, and the root's verification export go with it. The suites read
the Limrun SDK boundary instead of the provider package, so they assert what the account or the
attached instance is asked for: the scoped credentials, the host's version, and the selected
platform, with no runtime set up on `connect`.

* refactor(limrun): pass only the three Apple tools the iOS runner uses

* refactor(limrun): declare the plugin's connection in its return type

limrunPlugin always declares a connection, so its type says so and the built-in connection no longer checks for a missing one.
hannojg pushed a commit to hannojg/agent-device that referenced this pull request Nov 23, 2026
* refactor(limrun): add transitional v2 plugin factory and move credentials to the provider package

Issue callstack#3311. Builds on callstack#4720 (provider-plugin host).

- Add packages/provider-limrun/src/plugin.ts: the single transitional
  limrunPlugin(options) factory. Its setup reads credentials, builds
  runtime dependencies through the injected plugin host, and loads the
  runtime with the platform module; its credentials declaration keeps
  per-backend fingerprint narrowing.
- Move the credential reader and declaration from
  src/provider-limrun-credentials.ts to
  packages/provider-limrun/src/credentials.ts so the provider package
  owns credential interpretation.
- Expose the factory through the new lazy, SDK-free
  @agent-device/provider-limrun/internal entry; the built-in candidate
  in src/builtin-provider-plugins.ts composes the factory with the
  root-owned runtime dependencies and state paths, preserving
  dormant/failed/active candidate semantics.
- Rewire src/cli/connection and the daemon credential test to the
  internal entry; drop the migrated root-module-zone row; update the
  boundary and dependency pins, package manifests, and lockfile.

* test(limrun): read credential names from plugin inventory

* style(limrun): format the reconciled factory call

* refactor(limrun): route the built-in connect through the provider's own v2 connection callbacks

Move the connect decisions into one provider-owned set of callbacks: the connect-flag
refusals (including --device), the per-platform credential narrowing, the connection
capabilities, and the verification read-only check now live in the provider package's
connection module, which the plugin declares lazily. The CLI composition drops its
hand-written Limrun adapter and runs the same callbacks through the plugin shape, wired
to the host the way the daemon's registry wires an installed plugin's, so both answers
come from the provider. The profile fields the host owns stay with the host: tenant,
session, run identity, state dir, and Metro settings.

* fix(limrun): retain saved named-session identity

* refactor(limrun): keep the connection's verification inside the provider

The built-in `connect` composed its provider's callbacks through the provider package's root entry
just to inject that provider's own read-only check, which evaluated the runtime the composition was
meant to keep lazy, and let a caller replace a verification it does not own. The connection now
loads the provider's own verification in the `verify` path alone, so the built-in and an installed
plugin answer with the same entry and nothing above the connection decides what it verifies through;
the plugin option, the verifier type, and the root's verification export go with it. The suites read
the Limrun SDK boundary instead of the provider package, so they assert what the account or the
attached instance is asked for: the scoped credentials, the host's version, and the selected
platform, with no runtime set up on `connect`.

* refactor(limrun): pass only the three Apple tools the iOS runner uses

* refactor(limrun): declare the plugin's connection in its return type

limrunPlugin always declares a connection, so its type says so and the built-in connection no longer checks for a missing one.
thymikee added a commit that referenced this pull request Nov 24, 2026
* refactor(limrun): add transitional v2 plugin factory and move credentials to the provider package

Issue #3311. Builds on #4720 (provider-plugin host).

- Add packages/provider-limrun/src/plugin.ts: the single transitional
  limrunPlugin(options) factory. Its setup reads credentials, builds
  runtime dependencies through the injected plugin host, and loads the
  runtime with the platform module; its credentials declaration keeps
  per-backend fingerprint narrowing.
- Move the credential reader and declaration from
  src/provider-limrun-credentials.ts to
  packages/provider-limrun/src/credentials.ts so the provider package
  owns credential interpretation.
- Expose the factory through the new lazy, SDK-free
  @agent-device/provider-limrun/internal entry; the built-in candidate
  in src/builtin-provider-plugins.ts composes the factory with the
  root-owned runtime dependencies and state paths, preserving
  dormant/failed/active candidate semantics.
- Rewire src/cli/connection and the daemon credential test to the
  internal entry; drop the migrated root-module-zone row; update the
  boundary and dependency pins, package manifests, and lockfile.

* test(limrun): read credential names from plugin inventory

* style(limrun): format the reconciled factory call

* refactor(limrun): route the built-in connect through the provider's own v2 connection callbacks

Move the connect decisions into one provider-owned set of callbacks: the connect-flag
refusals (including --device), the per-platform credential narrowing, the connection
capabilities, and the verification read-only check now live in the provider package's
connection module, which the plugin declares lazily. The CLI composition drops its
hand-written Limrun adapter and runs the same callbacks through the plugin shape, wired
to the host the way the daemon's registry wires an installed plugin's, so both answers
come from the provider. The profile fields the host owns stay with the host: tenant,
session, run identity, state dir, and Metro settings.

* fix(limrun): retain saved named-session identity

* refactor(limrun): keep the connection's verification inside the provider

The built-in `connect` composed its provider's callbacks through the provider package's root entry
just to inject that provider's own read-only check, which evaluated the runtime the composition was
meant to keep lazy, and let a caller replace a verification it does not own. The connection now
loads the provider's own verification in the `verify` path alone, so the built-in and an installed
plugin answer with the same entry and nothing above the connection decides what it verifies through;
the plugin option, the verifier type, and the root's verification export go with it. The suites read
the Limrun SDK boundary instead of the provider package, so they assert what the account or the
attached instance is asked for: the scoped credentials, the host's version, and the selected
platform, with no runtime set up on `connect`.

* refactor(limrun): pass only the three Apple tools the iOS runner uses

* refactor(limrun): declare the plugin's connection in its return type

limrunPlugin always declares a connection, so its type says so and the built-in connection no longer checks for a missing one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant